package com.sjy.project.fym.apply.service.impl;

import java.util.List;
import com.sjy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sjy.project.fym.apply.mapper.FyGoodsMapper;
import com.sjy.project.fym.apply.domain.FyGoods;
import com.sjy.project.fym.apply.service.IFyGoodsService;
import com.sjy.common.utils.text.Convert;

/**
 * 物资清单Service业务层处理
 * 
 * @author ljb
 * @date 2022-04-20
 */
@Service
public class FyGoodsServiceImpl implements IFyGoodsService 
{
    @Autowired
    private FyGoodsMapper fyGoodsMapper;

    /**
     * 查询物资清单
     * 
     * @param goodsId 物资清单主键
     * @return 物资清单
     */
    @Override
    public FyGoods selectFyGoodsByGoodsId(Long goodsId)
    {
        return fyGoodsMapper.selectFyGoodsByGoodsId(goodsId);
    }

    /**
     * 查询物资清单列表
     * 
     * @param fyGoods 物资清单
     * @return 物资清单
     */
    @Override
    public List<FyGoods> selectFyGoodsList(FyGoods fyGoods)
    {
        return fyGoodsMapper.selectFyGoodsList(fyGoods);
    }

    /**
     * 新增物资清单
     * 
     * @param fyGoods 物资清单
     * @return 结果
     */
    @Override
    public int insertFyGoods(FyGoods fyGoods)
    {
        fyGoods.setCreateTime(DateUtils.getNowDate());
        return fyGoodsMapper.insertFyGoods(fyGoods);
    }

    /**
     * 修改物资清单
     * 
     * @param fyGoods 物资清单
     * @return 结果
     */
    @Override
    public int updateFyGoods(FyGoods fyGoods)
    {
        fyGoods.setUpdateTime(DateUtils.getNowDate());
        return fyGoodsMapper.updateFyGoods(fyGoods);
    }

    /**
     * 批量删除物资清单
     * 
     * @param goodsIds 需要删除的物资清单主键
     * @return 结果
     */
    @Override
    public int deleteFyGoodsByGoodsIds(String goodsIds)
    {
        return fyGoodsMapper.deleteFyGoodsByGoodsIds(Convert.toStrArray(goodsIds));
    }

    /**
     * 删除物资清单信息
     * 
     * @param goodsId 物资清单主键
     * @return 结果
     */
    @Override
    public int deleteFyGoodsByGoodsId(Long goodsId)
    {
        return fyGoodsMapper.deleteFyGoodsByGoodsId(goodsId);
    }
}
